package com.gxsf.back.controller;

import com.gxsf.back.pojo.MarkSpeak;
import com.gxsf.back.pojo.ViolationList;
import com.gxsf.back.repo.MarkSpeakRepository;
import com.gxsf.back.repo.ViolationListRepository;
import com.gxsf.back.util.JsonUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Package: com.gxsf.back.controller
 * @ClassName: returnController
 * @Author: BeijiRonin
 * @CreateTime: 2021/5/3 23:50
 * @Description:
 */
@CrossOrigin
@RestController
@RequestMapping("/markSpeak_json")
@Slf4j
@Api("用户反馈接口")
public class MarkSpeakController {
    @Autowired
    MarkSpeakRepository markSpeakRepository;

    @PostMapping("/delete")
    @ApiOperation("删除")
    public void delete(@RequestBody Map<String, String> map) {
        String markSpeakItem = map.get("markSpeakItem");
        MarkSpeak markSpeak = JsonUtil.jsonToJava(markSpeakItem, MarkSpeak.class);
        markSpeakRepository.delete(markSpeak);
    }
}
